from PyQt5 import QtCore, QtGui, QtWidgets

class MyLabel(QtWidgets.QLabel):
    # 对比My_label来说，只保留了绘制裁剪功能
    def __init__(self, Frame):
        super(MyLabel, self).__init__()
        self.x1 = 90
        self.y1 = 90


    def paintEvent(self, event):
        super().paintEvent(event)

        center = QtCore.QPointF(90,90)
        painter = QtGui.QPainter(self)
        painter.setPen(QtGui.QPen(QtCore.Qt.red, 2, QtCore.Qt.SolidLine))
        painter.drawEllipse(center,80,80)
        painter.setPen(QtGui.QPen(QtCore.Qt.red, 10, QtCore.Qt.SolidLine))
        painter.drawPoint(center)
        painter.setPen(QtGui.QPen(QtCore.Qt.blue, 5, QtCore.Qt.SolidLine))
        painter.drawLine(90,90,self.x1,self.y1)
        
# import sys
# sys.path.append("/home/marcus/tutorials_ws/src/rovrqt/resource")
# from label import MyLabel